package com.mybatis_puls.demo.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mybatis_puls.demo.entity.Catelist;
import com.mybatis_puls.demo.service.CatelistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 小🌤
 * @since 2020-12-18
 */
@RestController
@RequestMapping("/catelist")
public class CatelistController {

     @Autowired
    private CatelistService catelistService;

     @RequestMapping("/info/{id}")
    public Object info(@PathVariable("id")Integer catid){
         QueryWrapper<Catelist> wrapper=new QueryWrapper<>();
         wrapper.eq("cate_id",catid);
         List<Catelist> list = catelistService.list(wrapper);
     return list;
     }
}

